module.exports = function (grunt) {
    grunt.initConfig({
        jade: {
            compile: { files: [
                { expand: true, cwd: 'src/jade', src: ['*.jade'], dest: 'build/view', ext: '.html' }
            ] }
        },
        coffee: {
            compile: {
                files: [
                    { expand: true, cwd: "src/coffee", src: "*.coffee", dest: "build/js", ext: ".js" }
                ]
            }
        },
        copy: {
            copy_resource: { files: [
                { expand: true, cwd: 'src', src: ['resource/**'], dest: 'build' }
            ] }
        },
        watch: {
            jade: { files: ['src/jade/*.jade'], tasks: ['jade'] },
            coffee: { files: ['src/coffee/*.coffee'], tasks: ['coffee'] },
            copy_resource: { files: ['src/resource/**'], tasks: ['copy:copy_resource'] }
        }
    });

    // 加载任务
    grunt.loadNpmTasks('grunt-contrib-jade');
    grunt.loadNpmTasks('grunt-contrib-coffee');
    grunt.loadNpmTasks('grunt-contrib-copy');
    grunt.loadNpmTasks('grunt-contrib-watch');
};